<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/master.xhtml">


        <ui:define name="menu">
            <ui:include src="../menu.xhtml" /> 
        </ui:define>
        <ui:define name="TituloModulo">
            Gestão de Financeira
        </ui:define>

        <ui:define name="TituloConteudoPrincipal">
            Conta Detalhes
        </ui:define>

        <ui:define name="ConteudoPrincipal">

            <p:messages globalOnly="true"/>

            <h:form>
                <h:panelGrid columns="4">
                    <p:panel  style="background: transparent; border: 0px;" header="#{bundle.idConta}">
                        <h:outputText value="#{contaController.selected.idConta}" title="#{bundle.idConta}"/>
                    </p:panel>
                    <p:panel style="background: transparent; border: 0px;" header="#{bundle.nomeConta}">
                        <h:outputText value="#{contaController.selected.nomeConta}" title="#{bundle.nomeConta}"/>
                    </p:panel>
                    <p:panel style="background: transparent; border: 0px;" header="#{bundle.numeroConta}" >
                        <h:outputText value="#{contaController.selected.numeroConta}" title="#{bundle.numeroConta}"/>
                    </p:panel>
                    <p:panel style="background: transparent; border: 0px;" header="Tipo de Conta" >
                        <h:outputText value="#{contaController.selected.idTipoConta.nomeTipoConta}" title="#{bundle.idTipoConta}"/>
                    </p:panel>

                </h:panelGrid>

                <p:outputPanel>  
                    <p:dataTable value="#{contaController.contaMoeda}" var="m">  

                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="Natureza" />  
                            </f:facet>  
                            <h:outputText value="#{m.moeda}" />  
                        </p:column>  

                        <p:column>  
                            <f:facet name="header">  
                                <h:outputText value="Montante" />  
                            </f:facet>  
                            <h:outputText value="#{m.valor}" />  
                        </p:column>  

                    </p:dataTable>  
                </p:outputPanel>  

                <p:commandButton action="#{contaController.destroyAndView}" value="#{bundle.eliminar}" ajax="false" />

                <p:commandButton action="Edit" value="#{bundle.editar}" ajax="false"/>

                <p:commandButton action="#{contaController.prepareCreate}" value="#{bundle.criar}" ajax="false" />

                <p:commandButton action="#{contaController.prepareList}" value="#{bundle.listar}" ajax="false"/>                

            </h:form>
        </ui:define>
    </ui:composition>

</html>
